package cn.com.open.itembank.dto;

import cn.com.open.itembank.common.BaseModel;
import cn.com.open.itembank.common.enums.DifficultyType;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by lucky on 2017/12/7.
 */
public class RuleDifficultyModel extends BaseModel {
    public RuleDifficultyModel() {
        this.chapterList = null;
        this.type = 0;
        this.subItemCount = 0;
        this.count = 0;
        this.durationStart = 0;
        this.durationEnd = 0;
        this.repeatTimes = 0;
        this.repeatInterval = 0;
        this.responseDuration = 0;
        this.isSubjective = false;
        this.subjectiveSearchScope = 0;
    }

    /**
     * 章节ID列表.
     */
    private List<String> chapterList;

    /**
     * 难度类型
     */
    private Integer type;

    /**
     * 子题数量
     */
    private Integer subItemCount;

    /**
     * 试题抽题数量
     */
    private Integer count;

    /**
     * 分数
     */
    private BigDecimal score;

    /**
     * 音频时长范围起始值
     */
    private Integer durationStart;

    /**
     * 音频时长范围截止值
     */
    private Integer durationEnd;

    /**
     * 音频重复播放次数
     */
    private Integer repeatTimes;

    /**
     * 音频重复播放间隔
     */
    private Integer repeatInterval;

    /**
     * 答题时间
     */
    private Integer responseDuration;

    /**
     * 是否人工判分（人工评阅true的是主观题目，仅填空题可用）
     */
    private boolean isSubjective;

    /**
     * 主观题搜索范围(仅填空题可用：0：主观；1：客观；2：全部)
     */
    private Integer subjectiveSearchScope;

    /**
     * Gets subjective search scope.
     *
     * @return the subjective search scope
     */
    public Integer getSubjectiveSearchScope() {
        return subjectiveSearchScope;
    }

    /**
     * Sets subjective search scope.
     *
     * @param subjectiveSearchScope the subjective search scope
     */
    public void setSubjectiveSearchScope(Integer subjectiveSearchScope) {
        this.subjectiveSearchScope = subjectiveSearchScope;
    }

    /**
     * Gets chapter list.
     *
     * @return the chapter list
     */
    public List<String> getChapterList() {
        if (chapterList == null) {
            chapterList = new ArrayList<>();
        }
        return chapterList;
    }

    /**
     * Gets type.
     *
     * @return the type
     */
    public Integer getType() {
        return type;
    }

    /**
     * Sets type.
     *
     * @param type the type
     */
    public void setType(Integer type) {
        this.type = type;
    }

    /**
     * Gets sub item count.
     *
     * @return the sub item count
     */
    public Integer getSubItemCount() {
        return subItemCount;
    }

    /**
     * Sets sub item count.
     *
     * @param subItemCount the sub item count
     */
    public void setSubItemCount(Integer subItemCount) {
        this.subItemCount = subItemCount;
    }

    /**
     * Gets count.
     *
     * @return the count
     */
    public Integer getCount() {
        return count;
    }

    /**
     * Sets count.
     *
     * @param count the count
     */
    public void setCount(Integer count) {
        this.count = count;
    }

    /**
     * Gets score.
     *
     * @return the score
     */
    public BigDecimal getScore() {
        return score;
    }

    /**
     * Sets score.
     *
     * @param score the score
     */
    public void setScore(BigDecimal score) {
        this.score = score;
    }

    /**
     * Gets responseDuration start.
     *
     * @return the responseDuration start
     */
    public Integer getDurationStart() {
        return durationStart;
    }

    /**
     * Sets responseDuration start.
     *
     * @param durationStart the responseDuration start
     */
    public void setDurationStart(Integer durationStart) {
        this.durationStart = durationStart;
    }

    /**
     * Gets responseDuration end.
     *
     * @return the responseDuration end
     */
    public Integer getDurationEnd() {
        return durationEnd;
    }

    /**
     * Sets responseDuration end.
     *
     * @param durationEnd the responseDuration end
     */
    public void setDurationEnd(Integer durationEnd) {
        this.durationEnd = durationEnd;
    }

    /**
     * Gets repeat times.
     *
     * @return the repeat times
     */
    public Integer getRepeatTimes() {
        return repeatTimes;
    }

    /**
     * Sets repeat times.
     *
     * @param repeatTimes the repeat times
     */
    public void setRepeatTimes(Integer repeatTimes) {
        this.repeatTimes = repeatTimes;
    }

    /**
     * Gets repeat interval.
     *
     * @return the repeat interval
     */
    public Integer getRepeatInterval() {
        return repeatInterval;
    }

    /**
     * Sets repeat interval.
     *
     * @param repeatInterval the repeat interval
     */
    public void setRepeatInterval(Integer repeatInterval) {
        this.repeatInterval = repeatInterval;
    }

    /**
     * Gets responseDuration.
     *
     * @return the responseDuration
     */
    public Integer getResponseDuration() {
        return responseDuration;
    }

    /**
     * Sets responseDuration.
     *
     * @param responseDuration the responseDuration
     */
    public void setResponseDuration(Integer responseDuration) {
        this.responseDuration = responseDuration;
    }

    /**
     * Is subjective boolean.
     *
     * @return the boolean
     */
    public boolean isSubjective() {
        return isSubjective;
    }

    /**
     * Sets subjective.
     *
     * @param subjective the subjective
     */
    public void setSubjective(boolean subjective) {
        isSubjective = subjective;
    }

    /**
     * Copy rule difficulty model.
     *
     * @return the rule difficulty model
     */
    public RuleDifficultySaveModel copyToSave() {
        RuleDifficultySaveModel model = new RuleDifficultySaveModel();
        model.setType(this.getType());
        model.setSubItemCount(this.getSubItemCount());
        model.setCount(this.getCount());
        model.setScore(this.getScore());
        model.setDurationStart(this.getDurationStart());
        model.setDurationEnd(this.getDurationEnd());
        model.setResponseDuration(this.getResponseDuration());
        model.setRepeatInterval(this.getRepeatInterval());
        model.setRepeatTimes(this.getRepeatTimes());
        model.setResponseDuration(this.getResponseDuration());
        model.setSubjective(this.isSubjective());
        model.getChapterList().addAll(this.getChapterList());
        model.setSubjectiveSearchScope(this.getSubjectiveSearchScope());

        return model;
    }
}
